<?php

class ActionHome extends Action {

	public function IsPermitted(){ return true; }
	public function Render(){

		$meta = Test::GetMetaClass();

		echo '<table class="report">';
		echo '<tr>';
		echo '<th>&nbsp;</th>';
		echo '<th class="expand nowrap">'.$meta->some_string->GetLabel().'</th>';
		echo '<th class="nowrap">'.$meta->some_integer->GetLabel().'</th>';
		echo '<th>&nbsp;</th>';
		echo '</tr>';
		$i = 0;
		foreach (Test::Select() as $x){
			echo '<tr>';
			echo '<th>' . ++$i .'</th>';
			echo '<td>' . new Html($x->some_string) . '</td>';
			echo '<td>' . new Html($x->some_integer) . '</td>';
			echo '<td><a href="'.new Html(new ActionEditTest($x)).'">edit</a></td>';
			echo '</tr>';
		}
		echo '</table>';


		echo '<a href="'.new Html(new ActionCreateTest()).'">+new</a>';

	}
}


?>
